package com.ts.code.creator.util;

import com.ts.code.creator.enums.CreateFileEnum;
import com.ts.code.creator.enums.ParamTypeEnum;
import com.ts.code.creator.enums.RetTypeEnum;
import com.intellij.openapi.project.Project;
import com.intellij.psi.PsiJavaFile;
import lombok.Data;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.List;

@Data
public class CreateCodeContext {
    private Project project;
    private String author;
    private PsiJavaFile adminControllerFile;
    private String adminControllerPackageName;
    private String adminControllerClassName;
    private String entityName;
    private String entityAlias;

    private ParamTypeEnum paramTypeEnum;
    private RetTypeEnum retTypeEnum;
    private String methodName;
    private String remark;

    /**
     * 要创建的文件类型
     */
    private List<CreateFileEnum> createFileTypes = new ArrayList<>();

    /**
     * 服务名称
     */
    private String service;

    private String serviceAlias;

    private String dateTime;

    private boolean existCreateMethod = true;

    public CreateCodeContext() {
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        dateTime = LocalDateTime.now().format(formatter);
    }

}
